package biz.inspeed.test.timer;

import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;

import biz.inspeed.test.tool.CommonUtil;

public class TimerMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Timer timer = new Timer();
		timer.scheduleAtFixedRate(new TimerTask1(), 0, 3000);
	}

	static class TimerTask1 extends TimerTask {

		@Override
		public void run() {
			System.out.println("现在是： " + CommonUtil.getCurrentTime());
			try {
				TimeUnit.SECONDS.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
